# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Krassy Boykinov <kboykinov@teamcentrixx.com>
pkgname=fdk-aac
pkgver=2.0.2
pkgrel=4
_gitrev=585981a49f2186b0d2e47c64bf6b5abf539395f8
pkgdesc="Fraunhofer FDK AAC codec library"
url="https://gitlab.freedesktop.org/wtaymans/fdk-aac-stripped"
arch="all"
license="FDK-AAC"
makedepends="cmake samurai"
subpackages="$pkgname-dev $pkgname-doc"
source="https://gitlab.freedesktop.org/wtaymans/fdk-aac-stripped/-/archive/$_gitrev/fdk-aac-stripped-$pkgver.tar.gz"
options="!check" # no upstream/available testsuite
builddir="$srcdir/fdk-aac-stripped-$_gitrev"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	install -Dm644 NOTICE \
		"$pkgdir"/usr/share/licenses/libfdk-aac/NOTICE
}

sha512sums="
e0e56396ed0be427302ed4b54fc6e8dc522a172c288b7c1ec40cc3a9ceb13518ca7bbb874bc71b88b2a91e0bbbe4ad0bab6910efa1db63d91e6370976641bac4  fdk-aac-stripped-2.0.2.tar.gz
"
